import java.sql.*;

public class DBInsertAPI extends DBAPI {
	public static void main(String args[])
	{
		
		DBInsertAPI db1=new DBInsertAPI();
		db1.dbUpdate("insert into student values(11,'Tanya','tanya_jain@hotmail.com')");
		
		ResultSet rs1= db1.dbQuery("select * from student");	
				
        //as long as there is next record do the while loop
        //don't read the first row as they are the column header
        try {
			while (rs1.next ())
			{
			    int idVal = rs1.getInt ("id");
			    //first column is 1, second column ie name is 2 or can refer by name of the column
			    String nameVal = rs1.getString (2);
			    String catVal = rs1.getString ("email");
			    System.out.println (
			            "id = " + idVal
			            + ", name = " + nameVal
			            + ", email = " + catVal);
			   //++count;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
       		
	}
	

}
